package com.xuecheng.content.interfaces.web;

import com.xuecheng.content.application.service.CourseBaseApplication;
import com.xuecheng.content.domain.model.dto.CoursePreviewDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2024-08-24  14:24
 */
@Api(tags = "课程公开查询接口")
@RestController
@RequestMapping("/open")
public class CourseOpenApi {

    @Autowired
    private CourseBaseApplication courseBaseApplication;

    @ApiOperation("查询视频课程信息")
    @GetMapping("/course/whole/{courseId}")
    public CoursePreviewDto openCourse(@PathVariable("courseId") Long courseId){

        return courseBaseApplication.queryCourseBasePreview(courseId);
    }
}
